from TurtleWorld import *
from math import *

world=TurtleWorld()
ark=Turtle()
ark.delay = 0  
#----------------------------TRIANGLES----------------------------#

def equilateral_tri(t, size=100, rotate=0):
    print "Equilateral Triangle, with Size:", size, "and Rotation:", rotate
    t.lt(rotate)
    for i in range(3):
        t.lt(120)
        t.fd(size)
    
    
#--------------------------QUADRILATERALS-------------------------#

def para(t, width=100, height=100, angle=120, rotate=0):
    print "Parallelogram, with Width:", width, "Height:", height, "Angle:", angle, "and Rotation:", rotate
    t.lt(rotate)
    for i in range(2):
        t.fd(width)
        t.rt(135)
        t.fd(height)
        t.rt(45)

def rhom(t, size=100, angle=120, rotate=0):
    print "Rhombus, with Size:", size, "Angle:", angle, "and Rotation:", rotate
    t.lt(rotate)
    for i in range(2):
        t.fd(size)
        t.rt(135)
        t.fd(size)
        t.rt(45)

def rect(t, width=150, height=100, rotate=0):
    print "Rectangle, with Width:", width, "Height:", height, "and Rotation:", rotate
    t.lt(rotate)
    for i in range(2):
        t.fd(height)
        t.rt()
        t.fd(width)
        t.rt()
    

def square(t, size=100, rotate=0):
    print "Sqaure, with Size:", size, "and Rotation:", rotate
    t.lt(rotate)
    for i in range(4):
        t.fd(size)
        t.rt()
 
#------------------------------MOVEMENT---------------------------#

def line(t, x=100, y=100):
    print "Line to a point X:", x, "over and Y:", y, "up"
    length=sqrt(x**2+y**2)
    t.lt(degrees(atan(x/y)))
    t.fd(sqrt(length))
    t.rt(degrees(atan(x/y)))

  
def move(t, x, y):
    print "Move without marking to a point X:", x, "over and Y:", y, "up"
    t.pu()
    t.fd(x)
    t.lt()
    t.fd(y)
    t.rt()
    t.pd()
    
#------------------------------OTHER SHAPES------------------------#

def star(t, type=144.75, type2=144.75):
    print "star 200=9/4 210=10/4 5 star 144.75"
    for i in range (5):
        t.fd (type)
        t.rt (type2)

def sptri(t, size=100, rotate=0):
    for i in range(3):
        t.lt(120)
        t.fd(size)
    t.rt (180)
    t.fd(100)
    t.lt(360)
    for i in range(3):
        t.rt()
        t.fd(size)
# mees with /
def eqstar(t, size=100/1, rotate=0):
    for i in range(3):
        for i in range(3):
            t.lt(120)
            t.fd(size)
        t.rt (180)
        t.fd(100)
        t.lt(300)
        for i in range(3):
            t.rt(120)
            t.fd(size)
    
    
    
"""Build any other shape functions you want.
Some Ideas:
    Right Triangles (sss, sas, etc)
    Arbitrary Triangles
    Circle
    Arcs
    Go Wild!
    
Bonus for working or challenging functions...no penalty for trying something
"""

#------------------------------TEST-------------------------------#

eqstar(ark)
wait_for_user()
